<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>医院论坛</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link href="jsTools/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript" src="jsTools/jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="jsTools/bootstrap-3.3.7-dist/js/bootstrap.min.js"></script>
    
    <script type="text/javascript" src="jsTools/jquery-ui-1.12.1.custom/jquery-ui.js"></script> 
    <link href="jsTools/jquery-ui-1.12.1.custom/jquery-ui.css" rel="stylesheet"></link> 
   
    <script src="jsTools/jquery-validation-1.16.0/dist/jquery.validate.min.js"></script>
    <script src="jsTools/jquery-validation-1.16.0/dist/localization/messages_zh.js"></script>
    <script src="jsTools/jquery-validation-1.16.0/dist/additional-methods.js"></script>
    
     <script src="jsTools/jquery.growl/javascripts/jquery.growl.js"></script>
    <link href="jsTools/jquery.growl/stylesheets/jquery.growl.css" rel="stylesheet"></link> 
    
    <link rel="stylesheet" href="jsTools/jquery-treeview-master/jquery.treeview.css" />
	<link rel="stylesheet" href="/jsTools/jquery-treeview-master/screen.css" />
	<script src="jsTools/jquery-treeview-master/jquery.cookie.js"></script>
	<script src="jsTools/jquery-treeview-master/jquery.treeview.js" type="text/javascript"></script>
    
  </head>
  
  <body>
   <div class="container-filed">
	<div class="row clearfix" >
    	<div class="col-sm-4" style="margin-top: 50">
    		<ul id="treeview" class="filetree treeview-red" >
    		
    		</ul>
    	</div>
    	<div class="col-sm-8">
    		<iframe frameborder="0" scrolling="no" id="fame" src="DispatchAction.action?method=inSearchTopicList&id=1" height="100%" width="100%"></iframe>
    	</div>
    </div>
   </div>
  </body>
  	
  <script type="text/javascript">
  function iframe(id)
  {
  	$("#fame").attr("src","DispatchAction.action?method=inSearchTopicList&id="+id);
  }
  
  	$.get("DispatchAction.action?method=section",function(data){ var s=JSON.parse(data);
  		for(var i=0;i<s.length;i++)
  		{			
  				if(s[i].list!='')
  				{
  				
  					$("#treeview").append("<li id='"+s[i].id+"' >"+s[i].name+"<ul></ul></li>");
  					treeList(s[i].list,$("#"+s[i].id +" ul"));
  				}
  				else{
  				$("#treeview").append("<li  id='"+s[i].id+"'><a  href='javascript:iframe("+s[i].id+")'>"+s[i].name+"<label class='label label-info'>帖子数"+s[i].topicCount+"</label></a></li>");
  				}
  		}		
  	});
  function treeList(s,element)
  	{
  		for(var i=0;i<s.length;i++)
  		{
  			if(s[i].list!='')
  				{
  					element.append("<li id='"+s[i].id+"' >"+s[i].name+"<ul></ul></li>");				
  					treeList(s[i].list,$("#"+s[i].id+" ul"));
  				}
  				else
  				element.append("<li id='"+s[i].id+"'><a  href='javascript:iframe("+s[i].id+")'>"+s[i].name+"<label class='label label-info'>帖子数"+s[i].topicCount+"</label></a></li>");	
  		}
  	}
  	
  	$(document).ready(function(){
  		$("#treeview").treeview({
  			collapsed: true,
				animated: "medium",
				control:"#sidetreecontrol",
				persist: "location"
			});
		});	
  
  </script>
</html>
